package com.xjh.basestudy.javabase.javaweb.druid;/*
package javaweb.druid;

import javaweb.jdbc.util.JDBCUtil2;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

*/
/**
 * 使用工具类JDBCUtil2
 *//*

public class DruidDemo2 {
    public static void main(String[] args){
        //给account表添加一条记录
        Connection conn = null;
        PreparedStatement pstmt = null;
        try {
            //1.获取连接
            conn = JDBCUtil2.getConnection();
            //2.定义sql
            String sql = "insert into account valuses(null,?,?)";
            //3.获取PreParedStatement对象
            pstmt = conn.prepareStatement(sql);
            //4.给？赋值
            pstmt.setString(1,"wangwu");
            pstmt.setDouble(2,3000);
            //5.执行sql
            int count = pstmt.executeUpdate();
            System.out.println(count);
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            JDBCUtil2.close(pstmt,conn);

        }
    }

}
*/
